'''
通过转变成为字符串实现反转数字
'''
Class Solution:
    def reverse(self , x ):
        # write code here
        s=str(x)
        if s[0]=='-':
            return int(s[0]+s[1:][::-1])
        else:
            return int(s[::-1])